package com.service.yk.oktttpdemo.service;

import okhttp3.OkHttpClient;

/**
 * @author wangyongkun
 * @Description: 构建Okhttp 基础请求方式
 * @Date: 2020/4/2 14:17
 */
public class Demo {

private static OkHttpClient  okHttpClient = null;



    // 创建一个okhttp实例,整个应用使用一份就可以
    public OkHttpClient getOkHttpInstance(){
        if (okHttpClient == null){
            synchronized(this){
                okHttpClient = new OkHttpClient();
            }
        }
        return okHttpClient;
    }
}
